﻿using System;  
using System.Collections.Generic;  
using System.Runtime.CompilerServices;  
using System.Linq.Expressions;  
using System.Web.Mvc;  
namespace System.Web.Mvc  
{  
    public static class HtmlExtensions  
    {  
        public static MvcHtmlString MyTag(this HtmlHelper html, string name, string id = "")  
        {  
            string innerHtml = string.Format("My Name Is: {0}", name);  
            TagBuilder tagBuilder = new TagBuilder("span");  
            tagBuilder.InnerHtml = innerHtml;  
            if(!string.IsNullOrEmpty(id))   
            {  
                tagBuilder.Attributes.Add("id", id);  
            }  
            return MvcHtmlString.Create(tagBuilder.ToString());  
        }  
    }  
}